package me.learn.javaweb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.learn.javaweb.dao.CompanyMapper;
import me.learn.javaweb.pojo.Company;
import me.learn.javaweb.service.ICompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements ICompanyService {
    @Autowired
    private CompanyMapper companyMapper;

    @Override
    public Company getCompany(String name) {
        return companyMapper.selectOne(new LambdaQueryWrapper<Company>().eq(Company::getCompanyName, name));
    }
}
